package com.linko.intelligent.sys.api;

import com.linko.intelligent.base.CommonResponse;
import com.linko.intelligent.sys.pojo.po.User;
import com.linko.intelligent.sys.pojo.query.UserQuery;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author yuan
 * @create 2023/4/17 16:53
 */
@FeignClient(name = "linko-intelligent-sys-service")
@RequestMapping("/sys/user")
public interface ApiUserService {

    @ApiOperation("详情")
    @GetMapping(value = "/{id}")
    public CommonResponse<User> get(@PathVariable("id") Long id);

    @ApiOperation("列表")
    @GetMapping(value = "/list")
    public CommonResponse<List<User>> list(@SpringQueryMap UserQuery query);

    /***
     * 根据名字找ID
     * @return
     */
    @ApiOperation("根据名字找ID")
    @PostMapping(value = "/find/{name}")
    public CommonResponse<Long> findIdByName(@RequestBody List<User> all, @PathVariable("name") String name);
}
